﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="course2.aspx.cs" Inherits="course2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>表单</title>
    <link href="/layui/css/layui.css" rel="stylesheet" type="text/css" />  
    <style>
        th{
            background-color:aquamarine;
        }
    </style>
    <script src="/layui/layui.js"></script>
    <script>
        layui.use(['element', 'layer',], function () {
            var $ = layui.jquery
                , layer = layui.layer
            $('.lookmore').on('click', function () {
                var title = getTitle(this);
                //alert(title);
                 parent.layer.open({
                    type: 2
                    , content: ['/student/bookInfo2.aspx?title=' + title, 'no'] //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                    , area: '300px;'
                    , offset: '50px'
                    , area: ['700px', '90%']
                });
            });
        });
    </script>
    <script src="http://47.94.147.215/static/plugins/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        function getTitle(x) {
            //获取当前所在行
            var theTR = x.parentNode.parentNode;
            var theTD = theTR.cells[0];
            
            return theTD.innerText;
            //需要引入jquery才能获取当前行对应的值
            //     var id=$(x).parent().find(".first").val();
            //alert(id)
        }
        function checkvalue() {
            //alert($("input[name='search_key']").val());
            if ($("input[name='search_key']").val() == null || $("input[name='search_key']").val() == "") {
                var label = document.getElementById("prompt");
                label.innerText = "关键字不能为空";
                //alert(label.innerText);
                return false;
            }
            else {
                return true;
            }
            
            //return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" >
        <div>
            <%--<p id="p_test" runat="server">test</p>--%>
            <div class="layui-row" style="height:50px">
              
                <%--<span id="error" runat="server" style="display:none;color:red;right:600px;position:absolute"></span>--%>
                <div style="left:10%;position:absolute">
                     <asp:Button  CssClass="layui-btn" ID="refresh_btn" runat="server" Text="刷新" OnClick="refresh_btn_Click" />
                </div>
                <div style="right:10%;position:absolute">
                    <label id="prompt" style="color:red;"></label>
                    <input name="search_key" type="text" class="layui-input" style="display:inline-block;width:300px;"/>
                    <%--当onclick事件与onserverclick事件并存时，要设置为input，type="submit"才能使两者同时生效--%>
                    <input class="layui-btn layui-btn-normal " style="display:inline-block" id="search_btn" runat="server" 
                       type="submit" onclick="return checkvalue();" value="检索" onserverclick="search_btn_ServerClick"/>
               </div>
            </div>
            <table id="booksTable" runat="server"  class="layui-table" style="width:800px;margin-left:10%;">
                <colgroup>
                    <col width="100">
                    <col width="200">
                    <col width="200">
                    <col width="100">
                </colgroup>
               <%-- <tr>
                    <th>课程名</th>
                    <th>作者</th>
                    <th>出版社</th>
                    <th>操作</th>
                </tr>--%>
            </table>
        </div>
        
    </form>
</body>
</html>

